﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:Licenta3" xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
	xmlns:converters="clr-namespace:Licenta3.converters"
	mc:Ignorable="d"
	x:Class="Anexa16View"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480" Width="400" Height="800" Background="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Licenta3;component/Simple Styles.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
			<local:Anexa16ViewModel x:Key="Anexa16ViewModelDataSource" d:IsDataSource="True"/>
		</ResourceDictionary>
	</UserControl.Resources>
	<UserControl.DataContext>
		<Binding Source="{StaticResource Anexa16ViewModelDataSource}"/>
	</UserControl.DataContext>
	<ScrollViewer VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
		<telerik:ProportionalStackPanel Orientation="Vertical" ScrollViewer.CanContentScroll="True" Height="800" DataContext="{Binding}">
			<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Autorizat"/></TextBlock>
				<ComboBox Margin="4" ItemsSource="{Binding Setari.lAutorizat}" SelectedItem="{Binding Anexa.Autorizat}" SelectedValue="{Binding Anexa.Autorizat.Nume}" SelectedValuePath="Nume" DisplayMemberPath="Nume"/>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="OCPI"/></TextBlock>
				<ComboBox Margin="4" ItemsSource="{Binding Setari.lists.OCPI}" DisplayMemberPath="denumire" SelectedItem="{Binding Anexa.OCPI, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.OCPI.denumire}" SelectedValuePath="denumire">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="SelectionChanged">
							<i:InvokeCommandAction Command="{Binding UpdateUATImobilListCommand}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</ComboBox>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="BCPI"/></TextBlock>
				<ComboBox Margin="4" SelectedItem="{Binding Anexa.BCPI, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.BCPI.denumire}" ItemsSource="{Binding Anexa.OCPI.BCPI}" SelectedValuePath="denumire" DisplayMemberPath="denumire"/>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Adresă Imobil"/></TextBlock>
				<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.Imobil.Adresa.adresaIntreaga}"/>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="UAT"/></TextBlock>
				<ComboBox Margin="4" ItemsSource="{Binding UATImobilList}" DisplayMemberPath="Denumire" SelectedItem="{Binding Anexa.Imobil.UAT, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Anexa.Imobil.UAT.Denumire}" SelectedValuePath="Denumire"/>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Proprietar"/></TextBlock>
				<TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Anexa.proprietar.Nume}"/>
			</UniformGrid>
			<UniformGrid Rows="1" Height="32" VerticalAlignment="Top">
				<RadioButton Content="Dezlipire" Style="{DynamicResource SimpleRadioButton}" Margin="4" HorizontalAlignment="Center" VerticalAlignment="Center" IsChecked="{Binding Dezlipire, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
				<RadioButton Content="Alipire" Style="{DynamicResource SimpleRadioButton}" Margin="4" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding Dezlipire, Converter={StaticResource InvertBoolConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="2" Height="32" VerticalAlignment="Top">
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Center"><Run Language="ro-ro" Text="Data"/></TextBlock>
				<xctk:DateTimeUpDown Margin="4" Format="ShortDate" Text="{Binding DataPAD}" CultureInfo="ro-RO"/>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="1" Height="32" VerticalAlignment="Top" Margin="4">
				<Button Content="Selectează imobil" Margin="4" Command="{Binding SelectImobilGeometryCommand}"/>
			</UniformGrid>
			<telerik:RadGridView VerticalAlignment="Top" ItemsSource="{Binding Anexa.Imobil.Vecini}" Margin="4,4,4,-104.667" IsFilteringAllowed="False" ShowGroupPanel="False" AlternationCount="1" AutoExpandGroups="True" EditTriggers="CellClick" RowIndicatorVisibility="Collapsed" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Height="154" EnableLostFocusSelectedState="False" AutoGeneratingColumn="RadGridView_AutoGeneratingColumn">
				<telerik:StyleManager.Theme>
					<telerik:SummerTheme/>
				</telerik:StyleManager.Theme>
			</telerik:RadGridView>
			<telerik:RadGridView ItemsSource="{Binding Anexa.Imobile}" AutoGenerateColumns="False" Margin="4,4,4,-94.923" IsFilteringAllowed="False" ShowGroupPanel="False" ShowInsertRow="True" AlternationCount="1" AutoExpandGroups="True" EditTriggers="CellClick" RowIndicatorVisibility="Collapsed" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Height="154" VerticalAlignment="Top">
				<telerik:StyleManager.Theme>
					<telerik:SummerTheme/>
				</telerik:StyleManager.Theme>
				<telerik:RadGridView.Columns>
					<telerik:GridViewDataColumn DataMemberBinding="{Binding NrCadastral, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="Nr. Cad."/>
					<telerik:GridViewDataColumn DataMemberBinding="{Binding Descriere, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="Descriere"/>
					<telerik:GridViewColumn>
						<telerik:GridViewColumn.CellTemplate>
							<DataTemplate>
								<telerik:RadButton Content="Selectează"
									Command="{Binding DataContext.SelectImobileGeometryCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:ProportionalStackPanel}}}"
									CommandParameter="{Binding}"
								/>
							</DataTemplate>
						</telerik:GridViewColumn.CellTemplate>
					</telerik:GridViewColumn>
				</telerik:RadGridView.Columns>
			</telerik:RadGridView>
			<UniformGrid Rows="1" Columns="1" Height="32" VerticalAlignment="Top" Margin="4,4,4,0">
				<Button Content="PAD" Margin="4" Command="{Binding GenereazaPADCommand}"/>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="1" Height="32" VerticalAlignment="Top" Margin="4,4,4,0">
				<Button Content="Numerotează Construcții" Margin="4" Command="{Binding NumberConstructiiCommand}"/>
			</UniformGrid>
			<UniformGrid Rows="1" Columns="1" Height="32" VerticalAlignment="Top" Margin="4,4,4,0">
				<Button Content="Resetează" Margin="4" Command="{Binding ResetModelCommand}"/>
			</UniformGrid>
		</telerik:ProportionalStackPanel>
	</ScrollViewer>
</UserControl>